<?php if(!empty($output['auction'])){?>
<?php foreach($output['auction'] as $auction){?>
<div class="saleItem">
	  <div class="avatar">
	  	<a href="index.php?act=my&op=home&uid=<?php echo $auction['user_id'];?>">
	  		<img src="<?php echo $auction['avatar'];?>" width="90%">
	  	</a>
	  	<?php if($auction['guanzhu']==1 && $_COOKIE['user_id']!=$auction['user_id']){?>
	  	<div class="focus"><a href="javascript:;" class="guanzhu" seller_id="<?php echo $auction['user_id'];?>"><img src="<?php echo TEMPLATE_SITE_URL;?>/images/follow.png"></a></div>	  	
	  	<?php }?>
	  </div>
	  <div class="saleInfo">	  			
	        <div class="nickname">	          
		        <?php if($auction['is_company']==1){?>	 
		        	<?php if($auction['is_company_type']==1){?>
		        	<div class="business"></div>
		        	<?php }else{?>
		        	<div class="individual"></div>
		        	<?php }?>			            
		        <?php }?> 	
	            <a href="index.php?act=my&op=home&uid=<?php echo $auction['user_id'];?>">
	            	<div class="sellerLevel l<?php echo strtolower($auction['level'])?>"></div>
	            	<?php echo $auction['nickname'];?>
	            </a>
	            <div class="saleAttr"></div>
	        </div>			<div>专场id：<?php echo $auction['Relation_zc_id'];?></div>			<div>拍品id：<?php echo $auction['id'];?></div>			<div>开拍时间：<?php echo date("Y-m-d H:i",$auction['add_time']);?></div>			<div>截拍时间：<?php echo date("Y-m-d H:i",$auction['end_time']);?></div>
	        <div class="desc desc<?php echo $_GET['pagenum'];?> showdesc<?php echo $auction['id'];?>" data-auction_id="<?php echo $auction['id'];?>"><?php echo $auction['auction_description'];?></div>
	        <div class="more quanwen<?php echo $auction['id'];?>">
	        	<a href="javascript:;" class="quan" data-auction_id="<?php echo $auction['id'];?>" style="color:#526ba4;font-size: 14px;line-height: 30px;">全文</a>
	        </div>
	        
			<div class="imgList" imgall="<?php echo $auction['id'];?>">
	        	<?php if(!empty($auction['img'])){?>
	        	<?php foreach($auction['img'] as $v){?>
	        	<div aid="<?php echo $auction['id'];?>" style="background-image: url(<?php echo bearshop_cut_image(UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$v['auction_img']);?>)" 
	        		url="<?php echo BASE_SITE_URL.'/index.php?act=crontab&op=shuiyin&imageurl=';?><?php echo bearshop_cut_image(UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$v['auction_img'],1);?>" class="showimg<?php echo $_GET['pagenum'];?>"></div>
	        	<?php }?>
	        	<?php }?>
	        </div>
			
			<div>			<?php if($auction['auction_video']!=""){				?>				<div style="text-align:center;"><h1>视频展示</h1></div>				<video src="<?php echo $auction['auction_video']?>" controls style="width:100%;border:1px solid red;">您的浏览器不支持 video 标签。</video>				<?php			}?>
	        	
	        </div>
	        <div class="createTime">
	        	 <?php if($auction['freeship']==1){?>
	             <img src="<?php echo TEMPLATE_SITE_URL;?>/images/freepost.png" class="freePost"> 
	             <?php }?>
	             <?php if($auction['cashprice']>0){?>
	             <img src="<?php echo TEMPLATE_SITE_URL;?>/images/baozhengjin.png" class="hasBzj"> 
	             <?php }?>
	             <span style="color:#999"><?php echo date('m月d日',$auction['end_time']);?></span>
	             <div class="shareIt fenxiang" 
                        	auction_id="<?php echo $auction['id'];?>" 
                        	auction_description="<?php echo $auction['auction_description'];?>"
                        	nickname="<?php echo $auction['nickname'];?>"
                        	imgurl="<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$auction['auction_img1'];?>"
                        	auction_link="<?php echo BASE_SITE_URL;?>/index.php?act=index&type=1&auction_id=<?php echo $auction['id'];?>&user_id=<?php echo $_COOKIE['user_id']?>">
          		 分享</div>
          		 <?php $likeclass = 'likeIt';?>
          		 <?php $likecount = count($auction['like']);?>     
          		 <?php if(!empty($auction['like'])){?>   		 
          		 <?php foreach($auction['like'] as $like){?>
          		 <?php 
          		 	if($like['user_id']==$_COOKIE['user_id']){
	          		 	$likeclass='liked';
	          		 	break;
          		 	}
          		 ?>
          		 <?php }?>
          		 <?php }?>
				 <?php 
					 if($auction['is_company']==1){
					 	if($likecount>=$output['renzheng_likenum']){
					 		$likeclass='liked';
					 	}
					 }else{
					 	if($likecount>=$output['common_likenum']){
					 		$likeclass='liked';
					 	}
					 }
				 ?>
          		 <div class="<?php if(empty($likeclass)){ echo 'likeIt';}else{ echo $likeclass;}?>" like_auction_id=<?php echo $auction['id'];?>><?php echo $auction['likenum'];?></div>
          		 <div class="popularity"><?php echo $auction['viewnum'];?></div>
          		 
          		 <?php if(($_COOKIE['user_id']==$auction['seller_id'])){?>
	          		 <?php if(($auction['auction_log_id']>0)||($auction['yikoujia_end']==1)){?>
	          		 	 <?php if(($auction['end_time']<time())||($auction['yikoujia_end']==1)){?>	 
			          		 <?php if($auction['is_show']==1){?>
			          		<!-- <a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>-->
			          		 <?php }else{?>
			          		 <!--<a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>-->
			          		 <?php }?>
		          		 <?php }?>
	          		 <?php }else{?>
	          		 	<?php if(($auction['end_time']<time())){?>
	          		 	<?php if($auction['is_show']==1){?>
			          	<!--<a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>-->
			            <?php }else{?>
			            <!--<a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>-->
			            <?php }?>
	          		 	<?php }?>
	          		 <?php }?>         		 
          		 <?php }?>
	        </div>

	        <img like_img_auction_id="<?php echo $auction['id'];?>" src="<?php echo TEMPLATE_SITE_URL;?>/images/arrow_top.jpg" width="13" height="6" class="arrow_top" style="<?php if(empty($auction['like'])){ echo 'display:none;';}?>"> 
	        
	        <div class="likeBox" style="<?php if(empty($auction['like'])){ echo 'display:none;';}?>" like_div_auction_id="<?php echo $auction['id'];?>">	        	
	            <label class="likeRow" auctionavatar="<?php echo $auction['id'];?>">
	            <?php if(!empty($auction['like'])){?>	            
	            <?php foreach($auction['like'] as $like){?>
	                <a href="index.php?act=my&op=home&uid=<?php echo $like['user_id'];?>&user_id=<?php echo $_COOKIEE['user_id'];?>" class="likeAvatar" 
	                style="background-image: url(<?php echo $like['avatar'];?>)"></a>	                
	            <?php }?>	 
	            <?php }?>            
	            </label>	             
	        </div>   
	        <div class="moneyInfo">
	            <div><span>￥<?php echo $auction['firstprice'];?>元</span></div>
	            <div><span>￥<?php echo $auction['addprice'];?>元</span></div>
	            <div><span>￥<?php echo $auction['cashprice'];?>元</span></div>
	        </div>	        
	        
		    <div class="moneyInfoExtend">
		    	<?php if($auction['yikoujia']>0){?>    	
	            <div><span class="yikoujia">￥<?php echo $auction['yikoujia'];?>元</span></div>
	        	<?php }?>
	        	<?php if($auction['cankaojia']>0){?>
	        	<div><span id="cankaojia">￥<?php echo $auction['cankaojia'];?>元</span></div>
	        	<?php }?>
	        </div>
	    </div>
</div>
<?php }?>
<?php }?>


<script type="text/javascript">
$(function(){
	var selector = '.showimg'+'<?php echo $_GET['pagenum']?>';
	$(selector).click(function(){
		var current = $(this).attr('url');
		var aid = $(this).attr('aid');
		var images = {};
		images.current = current;
		images.urls = [];
		$('div[imgall="'+aid+'"]').children('div').each(function(){
			images.urls.push($(this).attr('url'));
		});
		
		wx.previewImage(images);
	});

	var selector_desc = '.desc'+'<?php echo $_GET['pagenum']?>';
	$(selector_desc).each(function(){
		var h = $(this).height();
		var auction_id = $(this).data('auction_id');
		if(h>98){
			$(this).height(98);
			$(this).css("overflow","hidden");
			$(".quanwen"+auction_id).show();	
		}else{
			$(this).css("overflow","visible");	 
			$(".quanwen"+auction_id).hide();
		}
	});

});
</script>

